package sean.org;

import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/anno")
public class DemoAnnoController {

	@RequestMapping(produces="text/plain;charset=UTF-8",value="/text")
	public @ResponseBody String index(HttpServletRequest request){
		return request.getRequestURL()+"";
	}
	
	@RequestMapping(produces="application/json;charset=UTF-8",value="/json")
	public @ResponseBody Object json(HttpServletRequest request){
		DemoObj demoObj = new DemoObj();
		demoObj.setId(123l);
		demoObj.setName("jvan");
		return demoObj;
	}
}
